<?php
if($threadlist) {
    $have_allowtop = 0;
    foreach($threadlist as &$_thread) {
        $_thread['allowtop'] = forum_access_mod($_thread['fid'], $gid, 'allowtop');
        if($_thread['allowtop']) $have_allowtop = 1;
    }
}
?>
<?php if($threadlist) { foreach($threadlist as &$_thread) {?>
<li class="tap <?php echo $_thread['top_class'];?> sky_thumb_list" data-href="<?php echo url("thread-$_thread[tid]");?>" data-tid="<?php echo $_thread['tid'];?>">

<?php if($_thread['image_number'] >= 4){?>
<article class="excerpt excerpt-multi">
    <header>
        <?php if($have_allowtop) { ?>
        <?php if($_thread['allowtop']) { ?>
        <input type="checkbox" name="modtid" class="mt-3 mr-2" value="<?php echo $_thread['tid']; ?>" />
        <?php } ?>
        <?php } ?>
        <!--{hook thread_list_inc_top_icon_before.htm}-->
        <?php if($_thread['top'] > 0) { ?>
        <i class="icon-top-<?php echo $_thread['top']; ?>"></i>
        <?php } ?>
        <!--{hook thread_list_inc_subject_top_after.htm}-->
        <h2>
            <!--{hook thread_list_inc_subject_before.htm}-->
            <a href="<?php echo url("thread-$_thread[tid]");?>" title="<?php echo $_thread['subject'];?>"><?php echo $_thread['subject'];?></a>
            <!--{hook thread_list_inc_subject_after.htm}-->
        </h2>
        <small class="text-muted" data-toggle="tooltip" data-placement="top" title="此文有 <?php echo $_thread['images'];?> 张图片"><i class="icon-image"></i> <?php echo $_thread['images'];?></small>
        <!--{hook thread_list_inc_filetype_icon_before.htm}-->
        <?php if($_thread['files'] > 0) { ?><small class="text-muted"><i class="icon small filetype other"></i></small><?php } ?>
        <!--{hook thread_list_inc_filetype_icon_after.htm}-->
        <!--{hook thread_list_inc_lock_icon_before.htm}-->
        <?php if($_thread['closed'] > 0) { ?><small class="text-muted"><i class="icon-lock"></i></small><?php } ?>
        <!--{hook thread_list_inc_lock_icon_after.htm}-->
    </header>
    <p class="text-muted time">
        <!--{hook thread_list_inc_username_before.htm}-->
        <a href="<?php echo url("user-$_thread[uid]");?>"><?php echo $_thread['username'];?></a>
        <!--{hook thread_list_inc_username_after.htm}-->
        发布于 <?php echo $_thread['create_date_fmt'];?>
        <!--{hook thread_list_inc_lastuid_before.htm}-->
        <?php if($_thread['lastuid']) { ?>
        <span>
            <span class="text-grey mx-2">←</span>
            <span class="username text-grey mr-1" uid="<?php echo $_thread['lastuid'];?>"><?php echo $_thread['lastusername'];?></span>
            <span class="text-grey"><?php echo $_thread['last_date_fmt'];?></span>
        </span>
        <?php } ?>
        <!--{hook thread_list_inc_lastuid_after.htm}-->
    </p>
    <p class="focus">
        <a href="<?php echo url("thread-$_thread[tid]");?>" class="thumbnail">
            <?php foreach($_thread['thumbs'] as $sky_val) {?>
                <span class="item"><span class="thumb-span"><img alt="<?php echo $_thread['subject'];?>" title="<?php echo $_thread['subject'];?>" class="thumb" src="<?php echo $sky_val['filename'];?>" style="display: inline;"></span></span>
            <?php }?>
        </a>
    </p>
    <p class="note"><?php echo $_thread['sky_desc'];?>...</p>
    <p class="text-muted views">
        <!--{hook thread_list_inc_view_before.htm}-->
        <span class="post-views">阅读(<?php echo $_thread['views'];?>)</span>
        <!--{hook thread_list_inc_view_after.htm}-->
        <!--{hook thread_list_inc_posts_before.htm}-->
        <span class="post-comments">评论(<?php echo $_thread['posts'];?>)</span>
        <!--{hook thread_list_inc_posts_after.htm}-->
    </p>
</article>
<?php }elseif($_thread['image_number'] > 0) {?>
<div class="excerpt excerpt-one">
    <header>
        <?php if($have_allowtop) { ?>
        <?php if($_thread['allowtop']) { ?>
        <input type="checkbox" name="modtid" class="mt-3 mr-2" value="<?php echo $_thread['tid']; ?>" />
        <?php } ?>
        <?php } ?>
        <!--{hook thread_list_inc_top_icon_before.htm}-->
        <?php if($_thread['top'] > 0) { ?>
        <i class="icon-top-<?php echo $_thread['top']; ?>"></i>
        <?php } ?>
        <!--{hook thread_list_inc_subject_top_after.htm}-->
        <h2>
            <!--{hook thread_list_inc_subject_before.htm}-->
            <a href="<?php echo url("thread-$_thread[tid]");?>" title="<?php echo $_thread['subject'];?>"><?php echo $_thread['subject'];?></a>
            <!--{hook thread_list_inc_subject_after.htm}-->
        </h2>
        <small class="text-muted" data-toggle="tooltip" data-placement="top" title="此文有 <?php echo $_thread['images'];?> 张图片"><i class="icon-image"></i> <?php echo $_thread['images'];?></small>
        <!--{hook thread_list_inc_filetype_icon_before.htm}-->
        <?php if($_thread['files'] > 0) { ?><small class="text-muted"><i class="icon small filetype other"></i></small><?php } ?>
        <!--{hook thread_list_inc_filetype_icon_after.htm}-->
        <!--{hook thread_list_inc_lock_icon_before.htm}-->
        <?php if($_thread['closed'] > 0) { ?><small class="text-muted"><i class="icon-lock"></i></small><?php } ?>
        <!--{hook thread_list_inc_lock_icon_after.htm}-->
    </header>
    <p class="text-muted time">
        <!--{hook thread_list_inc_username_before.htm}-->
        <a href="<?php echo url("user-$_thread[uid]");?>"><?php echo $_thread['username'];?></a>
        <!--{hook thread_list_inc_username_after.htm}-->
        发布于 <?php echo $_thread['create_date_fmt'];?>
        <!--{hook thread_list_inc_lastuid_before.htm}-->
        <?php if($_thread['lastuid']) { ?>
        <span>
            <span class="text-grey mx-2">←</span>
            <span class="username text-grey mr-1" uid="<?php echo $_thread['lastuid'];?>"><?php echo $_thread['lastusername'];?></span>
            <span class="text-grey"><?php echo $_thread['last_date_fmt'];?></span>
        </span>
        <?php } ?>
        <!--{hook thread_list_inc_lastuid_after.htm}-->
    </p>
    <p class="focus">
        <a href="<?php echo url("thread-$_thread[tid]");?>" class="thumbnail">
        <span class="item"><span class="thumb-span"><img alt="<?php echo $_thread['subject'];?>" title="<?php echo $_thread['subject'];?>" class="thumb" src="<?php echo $_thread['thumbs'][0]['filename'];?>" style="display: inline;"></span></span>
        </a>
    </p>
    <p class="note"><?php echo $_thread['sky_desc'];?>...</p>
    <p class="text-muted views">
        <!--{hook thread_list_inc_view_before.htm}-->
        <span class="post-views">阅读(<?php echo $_thread['views'];?>)</span>
        <!--{hook thread_list_inc_view_after.htm}-->
        <!--{hook thread_list_inc_posts_before.htm}-->
        <span class="post-comments">评论(<?php echo $_thread['posts'];?>)</span>
        <!--{hook thread_list_inc_posts_after.htm}-->
    </p>
</div>
<?php } else {?>
<article class="excerpt excerpt-multi">
    <header>
        <?php if($have_allowtop) { ?>
        <?php if($_thread['allowtop']) { ?>
        <input type="checkbox" name="modtid" class="mt-3 mr-2" value="<?php echo $_thread['tid']; ?>" />
        <?php } ?>
        <?php } ?>
        <!--{hook thread_list_inc_top_icon_before.htm}-->
        <?php if($_thread['top'] > 0) { ?>
        <i class="icon-top-<?php echo $_thread['top']; ?>"></i>
        <?php } ?>
        <!--{hook thread_list_inc_subject_top_after.htm}-->
        <h2>
            <!--{hook thread_list_inc_subject_before.htm}-->
            <a href="<?php echo url("thread-$_thread[tid]");?>" title="<?php echo $_thread['subject'];?>"><?php echo $_thread['subject'];?></a>
            <!--{hook thread_list_inc_subject_after.htm}-->
        </h2>
        <small class="text-muted" data-toggle="tooltip" data-placement="top" title="此文有 <?php echo $_thread['images'];?> 张图片"><i class="icon-image"></i> <?php echo $_thread['images'];?></small>
        <!--{hook thread_list_inc_filetype_icon_before.htm}-->
        <?php if($_thread['files'] > 0) { ?><small class="text-muted"><i class="icon small filetype other"></i></small><?php } ?>
        <!--{hook thread_list_inc_filetype_icon_after.htm}-->
        <!--{hook thread_list_inc_lock_icon_before.htm}-->
        <?php if($_thread['closed'] > 0) { ?><small class="text-muted"><i class="icon-lock"></i></small><?php } ?>
        <!--{hook thread_list_inc_lock_icon_after.htm}-->
    </header>
    <p class="text-muted time">
        <!--{hook thread_list_inc_username_before.htm}-->
        <a href="<?php echo url("user-$_thread[uid]");?>"><?php echo $_thread['username'];?></a>
        <!--{hook thread_list_inc_username_after.htm}-->
        发布于 <?php echo $_thread['create_date_fmt'];?>
        <!--{hook thread_list_inc_lastuid_before.htm}-->
        <?php if($_thread['lastuid']) { ?>
        <span>
            <span class="text-grey mx-2">←</span>
            <span class="username text-grey mr-1" uid="<?php echo $_thread['lastuid'];?>"><?php echo $_thread['lastusername'];?></span>
            <span class="text-grey"><?php echo $_thread['last_date_fmt'];?></span>
        </span>
        <?php } ?>
        <!--{hook thread_list_inc_lastuid_after.htm}-->
    </p>
    <p class="note"><?php echo $_thread['sky_desc'];?>...</p>
    <p class="text-muted views">
        <!--{hook thread_list_inc_view_before.htm}-->
        <span class="post-views">阅读(<?php echo $_thread['views'];?>)</span>
        <!--{hook thread_list_inc_view_after.htm}-->
        <!--{hook thread_list_inc_posts_before.htm}-->
        <span class="post-comments">评论(<?php echo $_thread['posts'];?>)</span>
        <!--{hook thread_list_inc_posts_after.htm}-->
    </p>
</article>
<?php }?>

</li>
<?php }} else { ?>
<li>
    <div><?php echo lang('none');?></div>
</li>
<?php } ?>